package com.ruyuan2020.im.design.mandator.use.command;

import com.ruyuan2020.im.design.mandator.use.Light;

// 关闭灯光命令实现
public class TurnOffLightCommand implements Command {
    private Light light;

    public TurnOffLightCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.turnOff();
    }

    @Override
    public void undo() {
        light.turnOn();
    }
}